package cn.iocoder.yudao.module.student.dal.mysql.collectJob;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.student.dal.dataobject.collectJob.CollectJobDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.student.controller.app.collectJob.vo.*;
import org.apache.ibatis.annotations.Param;

/**
 * 收藏职位 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface CollectJobMapper extends BaseMapperX<CollectJobDO> {

    default PageResult<CollectJobDO> selectPage(AppCollectJobPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CollectJobDO>()
                .eqIfPresent(CollectJobDO::getJobId, reqVO.getJobId())
                .eqIfPresent(CollectJobDO::getStudentId, reqVO.getStudentId())
                .likeIfPresent(CollectJobDO::getCity,reqVO.getCity())
                .eq(CollectJobDO::getDeleted,0)
                .orderBy(CollectJobDO.class, PageParam.DEFAULT_SORTING_FIELDS));
    }

    default List<CollectJobDO> selectList(AppCollectJobExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<CollectJobDO>()
                .eqIfPresent(CollectJobDO::getJobId, reqVO.getJobId())
                .betweenIfPresent(CollectJobDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
                .orderByDesc(CollectJobDO::getId));
    }
    void reduction(@Param("id") Long id);
}
